package com.srv.pojo;

import java.io.Serializable;

/*@Entity
@Table(name = "endereco")
@NamedQueries(value = {
		@NamedQuery(name = "Endereco.getListaEnderecos", query = "SELECT e FROM Endereco e"),
		@NamedQuery(name = "Endereco.getEnderecoByCep", query = "SELECT e FROM Endereco e WHERE e.cep = :cep"),
		@NamedQuery(name = "Endereco.getEnderecoByEndcode", query = "SELECT e FROM Endereco e WHERE e.endcode = :endcode") })*/
public class Endereco implements Serializable {

	private static final long serialVersionUID = -1525733244960000328L;

	/*@Id
	@Column(name = "endcode")
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@OneToMany(mappedBy = "endereco")*/
	private Long endcode;

	/*@ManyToOne
	@JoinColumn(name = "bacode", nullable = false)*/
	private Bairro bairro;

	/*@Column(name = "cep", length = 8, nullable = false)*/
	private String cep;

	/*@Column(name = "nome", nullable = false, length = 72)*/
	private String nome;

	/*@Column(name = "complemento", nullable = false, length = 72)*/
	private String complemento;

	public Long getEndcode() {
		return endcode;
	}

	public void setEndcode(Long endcode) {
		this.endcode = endcode;
	}

	public Bairro getBairro() {
		return bairro;
	}

	public void setBairro(Bairro bairro) {
		this.bairro = bairro;
	}

	public String getCep() {
		return cep;
	}

	public void setCep(String cep) {
		this.cep = cep;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getComplemento() {
		return complemento;
	}

	public void setComplemento(String complemento) {
		this.complemento = complemento;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((endcode == null) ? 0 : endcode.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Endereco other = (Endereco) obj;
		if (endcode == null) {
			if (other.endcode != null)
				return false;
		} else if (!endcode.equals(other.endcode))
			return false;
		return true;
	}

}
